package wator.view.swing.jogl;

import wator.model.Integer1DVector;
import wator.model.Integer3DVector;
import wator.model.IntegerVector;

/**
 * This factory converts a one dimensional vector into a three dimensional
 * vector by setting the y- and z-coordinate to zero.
 */
public class JoglVectorFactory1D implements JoglVectorFactory {

	/**
	 * Sets the y- and z-coordinate to zero, transfers other values from v. 
	 * Throws an exception if v is not one dimensional.
	 * {@inheritDoc}
	 */
	@Override
	public Integer3DVector generateVector(IntegerVector v) {
		return new Integer3DVector(((Integer1DVector) v).getX(), 0, 0);
	}
}